import { ApiProperty } from '@midwayjs/swagger';
import {
  CreateDateColumn,
  UpdateDateColumn,
  BaseEntity as TEntity,
  PrimaryColumn,
} from 'typeorm';

export class BaseEntity extends TEntity {
  @ApiProperty({ description: 'id' })
  @PrimaryColumn({ comment: '主键', name: 'id', type: 'bigint' })
  id?: string;

  @CreateDateColumn({
    name: 'create_time',
    comment: '创建日期',
  })
  createTime: Date;

  @UpdateDateColumn({
    name: 'update_time',
    comment: '更新日期',
  })
  updateTime: Date;
}
